<template>
  <div>
    <el-form :inline="true">
      <el-form-item>
        <el-button
          type="primary"
          @click="flush"
          icon="export"
        >重新汇总</el-button>
      </el-form-item>
    </el-form>
    <BrowseDataList
      :cate="cate"
      :cols="cols"
      :name="name"
    />
  </div>
</template>
<script>
import BrowseDataList from "@/components/BrowseDataList";
import { setSaveAfter2019 } from "@/api/案例分析.js";
import { showLoading, hideLoading } from "@/utils/loading";
import { getUser } from "@/utils/auth";
import { getZsqk } from "@/api/社会评价.js";
export default {
  components: {
    BrowseDataList
  },
  data() {
    return {
      cate: "招生情况",
      name: "9.1 招生情况",
      cols: [
        { prop: "JHJSS", label: "计划招生数(人)" },
        { prop: "XJLQS", label: "实际录取数(人)" },
        { prop: "SZLQL", label: "实际录取率(%)" },
        { prop: "SJBDS", label: "实际报到数(人)" },
        { prop: "SJBDL", label: "新生报到率(%)" }
      ]
    };
  },

  methods: {
    async flush() {
      try {
        showLoading();
        var user = getUser();
        await setSaveAfter2019(user.XXID, user.CJPC);
        hideLoading();
      } catch (e) {
        this.$alert(e);
      }
    },
    async fetchData() {
      var user = getUser();
      var datas = await getZsqk(user.XXID, user.CJPC);
      return datas;
    }
  }
};
</script>
<style>
</style>